package com.hsd.app.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hsd.app.dao.IHealthReportDao;
import com.hsd.app.service.IHealthReportService;
import com.hsd.core.base.dao.IBaseDAO;
import com.hsd.core.base.service.impl.BaseService;
import com.hsd.core.page.Finder;
import com.hsd.core.page.entity.PageParams;
import com.hsd.core.page.entity.Pagination;
import com.hsd.core.utils.PageParam;
import com.hsd.core.utils.PageUtil;

 
@SuppressWarnings("unchecked")
@Service
public class HealthReportServiceImpl extends BaseService implements IHealthReportService{
	@Autowired
	private IHealthReportDao healthMonitorDao;
	@Override
	public String loadOnePageData(String surveyuuid) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public IBaseDAO getBaseDao() {
		// TODO Auto-generated method stub
		return healthMonitorDao;
	}
	@Override
	public PageUtil loadMySurveyList(PageParam pageParam) {
		return this.healthMonitorDao.loadMySurveyList(pageParam);
	}

	@Override
	public Pagination loadReportList(PageParams pageParams, String username,
			String userid, String startdate, String enddate) {
		Finder finder = Finder.create("select r");
		finder.append(" from HsdHealthreport r ");
		finder.append(" where youxiaobj=1");
//		if(!StringUtils.isBlank(username)){
//			finder.append(" and r.username like:username");
//			finder.setParam("username", "%" + username + "%");
//		} 
		Pagination page = healthMonitorDao.find(finder, pageParams.getPageNo(), pageParams.getPageSize());
		return page;
	}
	 
}